import {httpGet, httpPost, httpDelete, httpPut} from '../services/http'
import {BaseDTO} from './base'
declare type Int64 = number

export interface CustomerQueryInput {
  projectId: string
  tel: string
  cardNo?: string
  mode?: number
}

export interface CustomerQueryOutput {
  data?: CustomerEntity
  result?: boolean
  msg?: string
}

export interface CustomerEntity {
  cstId?: string
  name?: string
  tel?: string
  cardNo?: string
  cardType?: string
}

export interface BookFeeQueryInput {
  projectId: string
  cstId: string
}

export interface BookFeeQueryOutput {
  data?: BookFeeEntity[]
  result?: boolean
  msg?: string
}

export interface BookFeeEntity {
  bookingId: string
  bookingCode: string
  roomId: string
  roomName: string
  filingsName: string
  feeId: string
  fundType: string
  fundName: string
  lastDate: null
  receivableAmount: number
  receivedAmount: number
  payableAmount: number
  dsAmount: number
}

export default {
  customer: {
    // 查询客户
    getCustomerInfo(cst: CustomerQueryInput): Promise<CustomerQueryOutput> {
      const path = `/api/pos/app/sale/getCustomer`
      return httpPost(path, cst).then(res => res.data.data)
    },
  },
  sale: {
    getBookFee(cst: BookFeeQueryInput): Promise<BookFeeQueryOutput> {
      const path = `/api/pos/app/sale/getBookFee`
      return httpPost(path, cst).then(res => res.data.data)
    },
    getYsFund(): Promise<any> {
      const path = `/api/pos/app/sale/getYsFund`
      return httpPost(path).then(res => res.data)
    },
  },
}
